from tvts import tvts
import random

ts = tvts('vgg16_tf2x_cifar10_2022_03', host='172.24.101.183', params={
    'lr': 1e-3,
    'batch_size': 128
})
print(f'Train id = {ts.train_id}')
ts.resume(4, 41)
for i in range(55 + random.randint(-7, 7)):
    epoch = i + 1
    path = None
    if i and i % ts.save_freq == 0:
        path = f'weight.{epoch}.nmp'
    cost = 5.43 + (i - 45) ** 2 - 20
    ts.save_epoch(epoch, {
        'cost': cost,
        'cost_val': cost + 100,
        'acc': cost + 100,
        'acc_val': cost + 200,
        'precision': cost + 300,
        'precision_val': cost + 400,
        'recall': cost + 500,
        'recall_val': cost + 600,
        'sse': cost + 1000,
    }, path)
